package com.yzh.luckydraw.domain.award.service.factory;

import com.yzh.luckydraw.common.Constants;
import com.yzh.luckydraw.domain.award.service.goods.IDistributionGoods;
import com.yzh.luckydraw.domain.award.service.goods.impl.CouponGoods;
import com.yzh.luckydraw.domain.award.service.goods.impl.DescGoods;
import com.yzh.luckydraw.domain.award.service.goods.impl.PhysicalGoods;
import com.yzh.luckydraw.domain.award.service.goods.impl.RedeemGoods;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 发奖奖品配置类
 */
public class GoodsConfig {
    protected static Map<Integer, IDistributionGoods> goodsMap = new ConcurrentHashMap<>();
    @Resource
    private CouponGoods couponGoods;
    @Resource
    private DescGoods descGoods;
    @Resource
    private PhysicalGoods physicalGoods;
    @Resource
    private RedeemGoods redeemGoods;
    
    @PostConstruct
    public void init() {
        goodsMap.put(Constants.AwardType.CouponGoods.getCode(), couponGoods);
        goodsMap.put(Constants.AwardType.DESC.getCode(), descGoods);
        goodsMap.put(Constants.AwardType.PhysicalGoods.getCode(), physicalGoods);
        goodsMap.put(Constants.AwardType.RedeemCodeGoods.getCode(), redeemGoods);
    }
}
